<h1>Listing searches</h1>

<table>
  <tr>
    <th>Keywords</th>
    <th>When</th>
  </tr>
  
<% for search in @searches %>
  <tr>
    <td><%= link_to h(search.keywords), search_path(search) %></td>
    <td><%= time_ago_in_words search.created_at %></td>
    <% admin do -%>
    <td><%= link_to 'Edit', edit_search_path(search) %></td>
    <td><%= link_to 'Destroy', search_path(search), :confirm => 'Are you sure?', :method => :delete %></td>
    <% end -%>
  </tr>
<% end %>
</table>
